home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / TCP_IP / TNOS230S / PPPIPCP.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-03  |  1.7 KB  |  62 lines

  1. #ifndef _PPPIPCP_H
  2. #define _PPPIPCP_H
  3.  
  4. #ifndef _SLHC_H
  5. #include "slhc.h"
  6. #endif
  7.  
  8.                     /* IPCP option types */
  9. #define IPCP_ADDRESSES        0x01
  10. #define IPCP_COMPRESS        0x02
  11. #define IPCP_ADDRESS        0x03
  12. #define IPCP_OPTION_LIMIT    0x03    /* highest # we can handle */
  13.  
  14. /* Table for IPCP configuration requests */
  15. struct ipcp_value_s {
  16.     int16 negotiate;        /* negotiation flags */
  17. #define IPCP_N_ADDRESSES    (1 << IPCP_ADDRESSES)
  18. #define IPCP_N_ADDRESS        (1 << IPCP_ADDRESS)
  19. #define IPCP_N_COMPRESS        (1 << IPCP_COMPRESS)
  20.  
  21.     uint32 address;            /* address for this side */
  22.     uint32 other;            /* address for other side */
  23.  
  24.     int16 compression;        /* Compression protocol */
  25.     int16 slots;            /* Slots (0-n)*/
  26.     byte_t slot_compress;        /* Slots may be compressed (flag)*/
  27. };
  28.  
  29. #define IPCP_SLOT_DEFAULT    16    /* Default # of slots */
  30. #define IPCP_SLOT_HI        64    /* Maximum # of slots */
  31. #define IPCP_SLOT_LO          1    /* Minimum # of slots */
  32. #define IPCP_SLOT_COMPRESS    0x01    /* May compress slot id */
  33.  
  34. struct ipcp_side_s {
  35.     int16 will_negotiate;
  36.     struct ipcp_value_s want;
  37.     struct ipcp_value_s work;
  38. };
  39.  
  40. /* Store address pool in otherwise unused address locations */
  41. #define peer_min    local.want.other    /* First IP address in pool */
  42. #define peer_max    remote.want.other    /* Last IP address in pool */
  43.  
  44. /* IPCP control block */
  45. struct ipcp_s {
  46.     struct ipcp_side_s local;
  47.     struct ipcp_side_s remote;
  48.  
  49.     struct slcompress *slhcp;    /* pointer to compression block */
  50. };
  51.  
  52. #define IPCP_REQ_TRY    20        /* REQ attempts */
  53. #define IPCP_NAK_TRY    10        /* NAK attempts */
  54. #define IPCP_TERM_TRY    10        /* tries on TERM REQ */
  55. #define IPCP_TIMEOUT    3        /* Seconds to wait for response */
  56.  
  57.  
  58. int doppp_ipcp (int argc, char *argv[], void *p);
  59. void ipcp_init (struct ppp_s *ppp_p);
  60.  
  61. #endif /* _PPPIPCP_H */
  62.